package com.boscloud.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.boscloud.pojo.*;
import com.boscloud.service.MaterialsStorageNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.boscloud.service.StorageLocationService;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@CrossOrigin //允许跨域
@RestController

public class MaterialsStorageNumberController {
    @Autowired
    private MaterialsStorageNumberService MaterialsStorageNumberService;
    @PostMapping("/MaterialsStorageNumber")//领料出库(领料单号)发出信息
    public List<MaterialsStorageNumber> getRecycleToneSlotsList(@RequestBody Map<String, Object> params) throws IOException {
        Map<String, String> headers = new HashMap<String, String>();
        headers.put("PORTID","ITMS020");//接口ID
        return MaterialsStorageNumberService.getMaterialsStorageNumberList(params,headers);
    }
    @PostMapping("/PostMaterialsStorageMateriel")//领料出库
    public List<PostGoodMvtResult> PostMaterialsStorageMateriel(@RequestBody MaterialsStoragePost MaterialsStoragePost) throws IOException {
        Map<String, String> headers = new HashMap<String, String>();
        headers.put("PORTID","ITMS022");//接口ID
        Map<String, Object> params  = JSONObject.parseObject(JSON.toJSONString(MaterialsStoragePost));
        return MaterialsStorageNumberService.PostMaterialsStorageMateriel(params,headers);
    }
}
